var app = getApp()
var Utils = require('../../../../utils/util.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tablist: ["待支付", "待接诊", "已到诊", "已结束", "已取消"],
    currentData: 0,
    dingdanall:[
      {
        orderno:555555555,
      imgs:"https://weiqing1.webstrongtech.net/attachment/images/2/2019/09/p5C5f0WxwwzW9WxE5HqtX5X1cXHt5e.jpg",
        names:"王医生",
        zhicheng:"主任医师",
        yiyuan:"白求恩医院",
        keshis:"胸外科",
        times:"2020-03-15 18:40",
        price:"10",
        youhui:"2",
        xiangmu:1,
        xmprice:8
      }, {
        orderno: 555555555,
        imgs: "https://weiqing1.webstrongtech.net/attachment/images/2/2019/09/p5C5f0WxwwzW9WxE5HqtX5X1cXHt5e.jpg",
        names: "王医生",
        zhicheng: "主任医师",
        yiyuan: "白求恩医院",
        keshis: "胸外科",
        times: "2020-03-15 18:40",
        price: "10",
        youhui: "2",
        xiangmu: 1,
        xmprice: 8
      }, {
        orderno: 555555555,
        imgs: "https://weiqing1.webstrongtech.net/attachment/images/2/2019/09/p5C5f0WxwwzW9WxE5HqtX5X1cXHt5e.jpg",
        names: "王医生",
        zhicheng: "主任医师",
        yiyuan: "白求恩医院",
        keshis: "胸外科",
        times: "2020-03-15 18:40",
        price: "10",
        youhui: "2",
        xiangmu: 1,
        xmprice: 8
      },
    ]
  },
  //点击切换，滑块index赋值
  checkCurrent: function (e) {
    if (this.data.currentData === e.target.dataset.current) {
      return false;
    } else {
      this.setData({
        currentData: e.target.dataset.current
      })
    }
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var bgc = wx.getStorageSync('color')
    wx.setNavigationBarColor({
      frontColor: "#ffffff",
      backgroundColor: bgc,
    })
  },
  //取消订单
  cancel(){},
  //去支付
  gopay(){
    wx.requestPayment({
      timeStamp: '',
      nonceStr: '',
      package: '',
      signType: '',
      paySign: '',
    })
  },
  //去退款
  refund(){

  },
  //完成
  finish(){},
  //删除
  deleteitem(e){
    let dex = e.currentTarget.dataset.dex, arrs = this.data.dingdanall
    arrs.splice(dex,1);
    this.setData({
      dingdanall: arrs
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    
  }
})